package com.magicborrow.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.magicborrow.R;

/**
 * Created by Administrator on 2016/5/18.
 */
public class AgreementActivity extends BaseActivity implements View.OnClickListener{


    private ImageView iv_back;
    private RelativeLayout first;
    private RelativeLayout second;
    private RelativeLayout third;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_agreement);
        initView();
        initListener();
    }

    private void initView(){
        first = (RelativeLayout)findViewById(R.id.first);
        second = (RelativeLayout)findViewById(R.id.second);
        third = (RelativeLayout)findViewById(R.id.third);
        iv_back =(ImageView)findViewById(R.id.iv_back);
        iv_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
    private void initListener(){
        first.setOnClickListener(this);
        second.setOnClickListener(this);
        third.setOnClickListener(this);
    }

    @Override
    public void onClick(View v){
        Intent intent = new Intent();
        switch (v.getId()){
            case R.id.first:
                intent.setClass(this,FirstProtolActivity.class);
                break;
            case R.id.second:
                intent.setClass(this,SecondProtolActivity.class);
                break;
            case R.id.third:
                intent.setClass(this,ThirdProtolActivity.class);
                break;
        }
        startActivity(intent);
    }

}
